home *** CD-ROM | disk | FTP | other *** search
/ Pascal Super Library / Pascal Super Library (CW International)(1997).bin / REFERENC / TPR / SOURCE.EXE / PAGEDEMO.PAS < prev    next >
Pascal/Delphi Source File  |  1992-08-10  |  1KB  |  47 lines

  1. { PAGEDEMO.PAS }
  2. program PageDemo;
  3. { Demonstrates multiple video pages by writing to page #0 and displaying
  4.   that page.  Then, by calling SetActivePage ( 1 ), switches to Page #1
  5.   and sends output to that page while still display page #0.  After
  6.   writing the output to Page #1, the program then switches back and
  7.   forth between the two pages.
  8.   This program should only be run in graphic modes that support
  9.   multiple pages.
  10. }
  11. uses
  12.   Graph;
  13.  
  14. var
  15.   GraphBuffer : Pointer;
  16.   GraphDriver, GraphMode : Integer;
  17.   TheText : String;
  18.  
  19. begin
  20.   { Check for VGA and select a multi-page mode }
  21.   DetectGraph ( GraphDriver, GraphMode );
  22.  
  23.   { This code may be different for your monitor }
  24.   if  GraphDriver = VGA then
  25.     GraphMode := VGALo;
  26.  
  27.   InitGraph ( GraphDriver, GraphMode, '\BP\BGI');
  28.  
  29.   SetVisualPage ( 0 );
  30.   SetActivePage ( 0 );
  31.  
  32.   SetTextJustify (CenterText, CenterText);
  33.   SetTextStyle( TriplexFont, HorizDir, 3);
  34.   OutTextXY (GetMaxX div 2, GetMaxY div 2, 'This is Page #0');
  35.  
  36.   SetActivePage ( 1 );
  37.   OutTextXY ( GetMaxX div 2, GetMaxY div 2, 'This is Page # 1');
  38.   Line ( 50, 50, 150, 150 );
  39.   Readln;
  40.   SetVisualPage ( 1 );
  41.   Readln;
  42.   SetVisualPage ( 0 );
  43.   Readln;
  44.  
  45.   CloseGraph;
  46. end.
  47.